/*
 * NumberHelper.java
 *
 * Created on April 8, 2007, 9:36 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package helpers;

import java.text.DecimalFormat;
import java.text.NumberFormat;

/**
 *
 * @author Alirio
 */
public class NumberHelper {
  
  public static String formatNumerForSQL(double number) {
    NumberFormat formatter = new DecimalFormat("0.00");
    return formatter.format(number).replaceFirst(",", ".");
  }
  
  public static boolean isDouble(String num) {
    boolean result = true;
    try {
      double aux = Double.parseDouble(num);
    } catch (NumberFormatException ex) {
      result = false;
    }
    return result;
  }
  
}
